home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gxiclass.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  2.8 KB  |  68 lines

  1. /* Copyright (C) 1999 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gxiclass.h,v 1.2 2000/09/19 19:00:37 lpd Exp $ */
  20. /* Define image rendering algorithm classes */
  21.  
  22. #ifndef gxiclass_INCLUDED
  23. #  define gxiclass_INCLUDED
  24.  
  25. /* Define the abstract type for the image enumerator state. */
  26. typedef struct gx_image_enum_s gx_image_enum;
  27.  
  28. #ifndef gx_device_DEFINED
  29. #  define gx_device_DEFINED
  30. typedef struct gx_device_s gx_device;
  31. #endif
  32.  
  33. /*
  34.  * Define the interface for routines used to render a (source) scan line.
  35.  * If the buffer is the original client's input data, it may be unaligned;
  36.  * otherwise, it will always be aligned.
  37.  *
  38.  * The image_render procedures work on fully expanded, complete rows.  These
  39.  * take a height argument, which is an integer >= 0; they return a negative
  40.  * code, or the number of rows actually processed (which may be less than
  41.  * the height).  height = 0 is a special call to indicate that there is no
  42.  * more input data; this is necessary because the last scan lines of the
  43.  * source data may not produce any output.
  44.  *
  45.  * Note that the 'w' argument of the image_render procedure is the number
  46.  * of samples, i.e., the number of pixels * the number of samples per pixel.
  47.  * This is neither the width in pixels nor the width in bytes (in the case
  48.  * of 12-bit samples, which expand to 2 bytes apiece).
  49.  */
  50. #define irender_proc(proc)\
  51.   int proc(P6(gx_image_enum *penum, const byte *buffer, int data_x,\
  52.           uint w, int h, gx_device *dev))
  53. typedef irender_proc((*irender_proc_t));
  54.  
  55. /*
  56.  * Define procedures for selecting imaging methods according to the class of
  57.  * the image.  Image class procedures are called in alphabetical order, so
  58.  * their names begin with a digit that indicates their priority
  59.  * (0_interpolate, etc.): each one may assume that all the previous ones
  60.  * failed.  If a class procedure succeeds, it may update the enumerator
  61.  * structure as well as returning the rendering procedure.
  62.  */
  63. #define iclass_proc(proc)\
  64.   irender_proc_t proc(P1(gx_image_enum *penum))
  65. typedef iclass_proc((*gx_image_class_t));
  66.  
  67. #endif /* gxiclass_INCLUDED */
  68.